package cn.edu.scau.cmi.xuandingcong.singleton;

import java.util.ArrayList;

import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;

public class MultitonDomain {
	@FXML
	private TextField tf;
	@FXML
	private TextArea ta ;
	ArrayList<Marshals> l = new ArrayList<Marshals>();
	
	public void muntitonDomain() {
		Marshals marshals = null ;
		l = Marshals.addInstance(tf.getText().trim());
		if( l.size()<=10 ) {
			ta.clear();
			for(int i=0; i<l.size(); i++) {
				
				ta.appendText(l.get(i).getName()+"\n");
				
			}
		}
		
		 if(Marshals.frag == 1) {
			ta.appendText("只能有10位元帅！\n");
		}
		
	}

}
